package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.MyCollection;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MyCollectionMapper {
    int deleteByPrimaryKey(Long id);

    /**
     * 保存收藏
     *
     * @param record
     * @return
     */
    int insert(MyCollection record);

    MyCollection selectByPrimaryKey(Long id);

    List<MyCollection> selectAll();

    int updateByPrimaryKey(MyCollection record);

    List<MyCollection> selectForList(QueryObject qo);


    /**
     * 查询游记是否收藏
     *
     * @param travelId
     * @param userId
     * @return
     */
    MyCollection selectCollection(@Param("travelId") Long travelId, @Param("userId") Long userId);

    /**
     * 删除游记收藏
     *
     * @param travelId
     * @param userId
     */
    void deleteTravel(@Param("travelId") Long travelId, @Param("userId") Long userId);

    /**
     * 查询攻略是否收藏
     *
     * @param strategyId
     * @param userId
     * @return
     */
    MyCollection selectStrategyCollection(@Param("strategyId") Long strategyId, @Param("userId") Long userId);

    /**
     * 删除攻略收藏
     *
     * @param strategyId
     * @param userId
     */
    void deleteStrategy(@Param("strategyId") Long strategyId, @Param("userId") Long userId);

    MyCollection selectNewsCollection(@Param("newsId") Long newsId, @Param("userId") Long userId);

    void deleteNews(@Param("newsId") Long newsId, @Param("userId") Long userId);
}